﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class RCustomer
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _nr = string.Empty;
        [DataMember]
        public string Nr
        {
            get { return _nr; }
            set { _nr = value; }
        }

        private string _address = string.Empty;
        [DataMember]
        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }

        private string _contactPersonTel = string.Empty;
        [DataMember]
        public string ContactPersonTel
        {
            get { return _contactPersonTel; }
            set { _contactPersonTel = value; }
        }

        private string _remark = string.Empty;
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        private decimal _intergral;
        [DataMember]
        public decimal Intergral
        {
            get { return _intergral; }
            set { _intergral = value; }
        }

        public override string ToString()
        {
            return Name;
        }

        public override bool Equals(object obj)
        {
            Customer temp = obj as Customer;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }
    }
}
